package pe.edu.unmsm.fisi.sisconteg.business.service.impl;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pe.edu.unmsm.fisi.sisconteg.business.service.ExperienciaLaboralService;
import pe.edu.unmsm.fisi.sisconteg.domain.model.Egresado;
import pe.edu.unmsm.fisi.sisconteg.domain.model.ExperienciaLaboral;
import pe.edu.unmsm.fisi.sisconteg.repository.dao.ExperienciaLaboralDAO;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class ExperienciaLaboralServiceImpl implements ExperienciaLaboralService {

	@Resource
	private ExperienciaLaboralDAO experienciaLaboralDAO;
	
//	@Resource
//	private EgresadoService egresadoService;
//	
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	@Override
	public void crearExperienciaLaboral(ExperienciaLaboral experienciaLaboral, Egresado egresado)
			throws DataAccessException {
		experienciaLaboral.setEgresado(egresado);
		experienciaLaboralDAO.crear(experienciaLaboral);
	}

}
